/**
 * @file CommonHelper.java
 * @info author:陈亚鹏  date:2012-9-26 上午10:16:46 version:1.0
 */
package site.helper;

/**
 * @type CommonHelper
 * @info author:陈亚鹏  date:2012-9-26 上午10:16:46 version:1.0
 */
public class CommonHelper {

	public static boolean IsNullOrEmpty(String str)
	{
		return str == null || str.trim().equals("");
	}
	
	public static String getExtension(String filename)
	{
		if (!IsNullOrEmpty(filename)) { 
            int dot = filename.lastIndexOf('.'); 
            if ((dot >-1) && (dot < (filename.length() - 1))) { 
                return filename.substring(dot + 1); 
            } 
        } 
        return filename; 
	}
}
